# Copyright 2023 The IREE Authors
#
# Licensed under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

load("//build_tools/bazel:enforce_glob.bzl", "enforce_glob")
load("//build_tools/bazel:iree_lit_test.bzl", "iree_lit_test_suite")

package(
    features = ["layering_check"],
    licenses = ["notice"],  # Apache 2.0
)

iree_lit_test_suite(
    name = "lit",
    srcs = enforce_glob(
        [
            "attr_based_pipeline.mlir",
            "conv2d_to_img2col.mlir",
            "conv_filter_to_channels_last.mlir",
            "conv_to_channels_last.mlir",
            "fold_attention_with_transpose.mlir",
            "generalize_linalg_matmul.mlir",
            "make_single_dispatch_for_function.mlir",
            "pad_linalg_ops.mlir",
            "pad_to_intrinsics_mfma.mlir",
            "pad_to_intrinsics_wmma.mlir",
            "pdl_example.mlir",
            "preprocessing_match_ops.mlir",
            "transform_symbol_importing.mlir",
            "sink_transpose_through_pad.mlir",
            "transpose_matmul.mlir",
        ],
        include = ["*.mlir"],
        exclude = [
            "external_function_spec.mlir",
            "pdl_patterns.mlir",
        ],
    ),
    cfg = "//compiler:lit.cfg.py",
    data = [
        "external_function_spec.mlir",
        "pdl_patterns.mlir",
    ],
    tools = [
        "//tools:iree-opt",
        "@llvm-project//llvm:FileCheck",
    ],
)
